package com.google.code.bexxgameoflife.model.data;

import static org.junit.Assert.*;

import org.junit.Test;

public class CellTest {

	@Test
	public void createDefaultCell() {
		new Cell();
	}

	@Test
	public void defaultCellIsDead() {
		Cell c = new Cell();
		assertTrue(c.isDead());
		assertFalse(c.isAlive());
	}

	@Test
	public void createLivingCell() {
		Cell c = new Cell(true);
		assertTrue(c.isAlive());
		assertFalse(c.isDead());
	}

	@Test
	public void createDeadCell() {
		Cell c = new Cell(false);
		assertTrue(c.isDead());
		assertFalse(c.isAlive());
	}
	
	@Test
	public void die() {
		Cell dead = new Cell(false);
		Cell alive = new Cell(true);
		alive.die();
		assertTrue(alive.isDead());
		dead.die();
		assertTrue(dead.isDead());
	}
	
	@Test
	public void wake() {
		Cell dead = new Cell(false);
		Cell alive = new Cell(true);
		dead.wake();
		assertTrue(dead.isAlive());
		alive.wake();
		assertTrue(alive.isAlive());
	}

}
